<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>欢迎访问产品运营互动中心！</title>
<link rel="stylesheet" href="<s:url value="/css/style_new.css"/>">
<link href="<s:url value="/images/08_ccxxzx.css"/>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<s:url value="/script/sysOper.js"/>"></script>
<script type="text/javascript" src="<s:url value="/script/selfResize.js"/>"></script>
<script type="text/javascript" src="<s:url value="/components/datepicker/WdatePicker.js"/>"></script>
<script>
function show(url){
	window.open(url);
}
function initLoad(){
	f_iframeResize();
}
window.onload = initLoad;
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table width="980" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				background="<s:url value="/images/new/gxzl_index_2.gif"/>">
				<tr>
					<td width="20" height="32">&nbsp;</td>
					<td width="20"><img
						src="<s:url value="/images/new/dq_dot.gif"/>" width="15"
						height="12" /></td>
					<td>当前位置：业务需求交互单-新产品开发</td>

				</tr>
			</table>
			</td>
		</tr>
	<tr>
		<td background="<s:url value="/images/home_4a.gif"/>">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
			<tr>
				<td width="20%" valign="top">
				<table width="100%" height="400"  border="0" cellspacing="0" cellpadding="0"
					align="center" bgcolor="#FFFFFF">
					<tr>
						<td valign="top" align="center">
						<s:form action="saveNewprodReq.action" namespace="/bpm" method="post"
						onsubmit="return validate();" enctype="multipart/form-data">
							<input type="hidden" name="newprodReq.id" value="${newprodReq.id}">
							<input type="hidden" name="newprodReq.begin" value="${newprodReq.begin}">
							<input type="hidden" name="newprodReq.end" value="${newprodReq.end}">
							<table width="98%" align="center" border="0" cellspacing="0" cellpadding="0">
								<br/>
								<tr>
									<td height="5">
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td width="5" height="5"><img src="<s:url value="/images/cphdzx_tab1.gif"/>" width="5" height="5" /></td>
												<td class="tdborderup"><img src="<s:url value="/images/spacer.gif"/>" width="1" height="1" /></td>
												<td width="5"><img src="<s:url value="/images/cphdzx_tab2.gif"/>" width="5" height="5" /></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td  class="tdborderleftright">
									<TABLE width="98%" cellSpacing=1 cellPadding=0 align="center">
										<TR height=30>
											<TD align=left width="10%">
											
											<input type="submit" name="Submit" value="保 存" onclick="submit1();"> 
											<input type="button" value="返 回" onClick="location.href='/bpm/listNewprodReq.action'">

												<input type="submit" value="流程启动" onClick="startup();">
											<s:if test='newprodReq.id!=null'>
											</s:if>
											</TD>
										</TR>
									</table><br>
									<s:if test='%{newprodReq.reqCode!=null}'>
										&nbsp;&nbsp;&nbsp;需求单号：${newprodReq.reqCode}
									</s:if>
									<table width="98%" border="0" cellspacing="0" cellpadding="7"
										align="center" class=tablecolor2>
										
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2"><font color="red">*</font>名&nbsp;&nbsp;&nbsp;&nbsp;称：</div></td>
                    <td colspan="3">
											<s:textfield name="newprodReq.name" theme="css_xhtml" size="110" />
                    </td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2"><font color="red">*</font>发 起 人：</div></td>
                    <td width="286">
											<input type="hidden" name="newprodReq.startPerson.id" value="${newprodReq.startPerson.id}">
											<input type="text" name="startPerson" readonly value="${newprodReq.startPerson.name}">
											<input type="button" name="selType" value="选择人员" onClick="selectStartPerson()" />
											
                    </td>
                    <td bgcolor="D6E3FA" width="140"><div align="right" class="STYLE2"><font color="red">*</font>发起部门：</div></td>
                    <td width="268">
                    	<input type="text" name="startDept" value="${newprodReq.startDept.name}" 
                    	 class="input_nob" size="40" readonly>
                    	<input type="hidden" name="newprodReq.startDept.id" value="${newprodReq.startDept.id}" >
                    	<input type="hidden" name="newprodReq.reqCode" value="${newprodReq.reqCode}">
                    </td>
                  </tr>

                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">期望完成时间：</div></td>
                    <td>
												<input type="text" name="advanTime" size="14" class="Wdate" onFocus="new WdatePicker(this)">
												<s:date name="newprodReq.advanTime" format="yyyy年MM月dd日"/>
												<input name="newprodReq.advanTime" type="hidden" value="${newprodReq.advanTime}">
                    </td>
                    <td bgcolor="D6E3FA" width="140"><div align="right" class="STYLE2">需求类别：</div></td>
                    <td width="268">
					<s:select name="newprodReq.type.id"
						list="types" listKey="id" listValue="name"
						theme="css_xhtml" />
                    </td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA" width="140"><div align="right" class="STYLE2">产品经理：</div></td>
                    <td width="268">
											<input type="hidden" name="newprodReq.prodPerson.id" value="${newprodReq.prodPerson.id}">
											<input type="text" name="prodPerson" readonly value="${newprodReq.prodPerson.name}">
											<input type="button" name="selType" value="选择人员" onClick="selectProdPerson()" />
                    </td>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">产品部门：</div></td>
                    <td>
                    	<input type="text" name="prodDept" value="${newprodReq.prodDept.name}" 
                    	 class="input_nob" size="40" readonly>
                    	<input type="hidden" name="newprodReq.prodDept.id" value="${newprodReq.prodDept.id}" >
                    </td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">公文编号：</div></td>
                    <td>
                    	<input type="text" name="newprodReq.officialNo" value="${newprodReq.officialNo}">
                    </td>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">公文名称：</div></td>
                    <td >
                    	<input type="text" name="newprodReq.officialName" value="${newprodReq.officialName}">
					  			</td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">重要性：</div></td>
                    <td >
						<s:select name="newprodReq.importance.id"
							list="importances" listKey="id" listValue="name"
							theme="css_xhtml" />
					  				</td>
                    <td bgcolor="D6E3FA" width="140">
                    </td>
                    <td width="268">
                    </td>
                  </tr>
                  
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2"><font color="red">*</font>内&nbsp;&nbsp;&nbsp;&nbsp;容：</div></td>
                    <td colspan="3">
											<s:textarea name="newprodReq.content" theme="css_xhtml" cols="96" rows="4" />
					  				</td>
                  </tr>
                  <tr> 
                    <td width="111" bgcolor="D6E3FA"> <div align="right" class="STYLE2">附&nbsp;&nbsp;&nbsp;&nbsp;件：</div></td>
                    <td colspan="3">
					<table width="90%" border="0" class=tablecolor2>
						<tr>
							<td width="60%" align="center" bgcolor="D6E3FA">附件名称</td>
							<td width="18%" align="center" bgcolor="D6E3FA">附件类型</td>
							<td width="18%" align="center" bgcolor="D6E3FA">删除</td>
						</tr>
						<s:iterator id="reqDocu" value="reqDocus">
						<input type="hidden" name="attachIDs" value="<s:property value="id" />"/>
						<tr>
							<td>
								<a href="<s:url value="/bpm/showDocu.action?reqDocu.id="/><s:property value="id" />"
									target="_blank">
									<s:property value="fullName" />
								</a>
							</td>
							<td align="center"> 
								<s:if test="docType==null">
									其他附件
								</s:if>	
								<s:else>
									<s:property value="docType.name"/>
								</s:else>	
							</td>
							<td align="center"><input type="checkbox"
								name="delIDs" value="<s:property value="id" />"></td>
						</tr>
						</s:iterator>
					</table>
					<br>
                      <table width="90%" border="0" class=tablecolor2>
                        <tr>
                          <td width="" colspan="2" align="left" bgcolor="D6E3FA">附件上传</td>
                        </tr>
                        <tr>
                          <td width="60px">
                          	商业计划书
                          	<input type="hidden" id="filetype" name="filetype" value="" />
                          </td>
                          <td align="left">
                          	<input type="file" name="upload" size="40"/>&nbsp;&nbsp;&nbsp;
                          	<a href="/common/busi_plan_temp.doc"
									target="_blank">
                          	模板下载
                          	</a>
                          </td>
                        </tr>
                        <tr>
                          <td>其他附件
                          	<input type="hidden" id="filetype" name="filetype" value="" />
                          </td>
                          <td><input type="file" name="upload" size="40"/>
                          </td>
                        </tr>
                        <tr>
                          <td>其他附件
                          	<input type="hidden" id="filetype" name="filetype" value="" />
                          </td>
                          <td><input type="file" name="upload" size="40"/>
                          </td>
                        </tr>
                      </table>
                      </div></td>
                  </tr>
                  <tr>
                    <td bgcolor="D6E3FA"><div align="right" class="STYLE2">备&nbsp;&nbsp;&nbsp;&nbsp;注：</div></td>
                    <td colspan="3">
											<s:textarea name="newprodReq.remark" theme="css_xhtml" cols="96" rows="4" />
					  				</td>
                  </tr>
                </table>
										
									</td>
								</tr>
								<tr>
									<td height="5">
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td width="5" height="5"><img src="<s:url value="/images/cphdzx_tab3.gif"/>" width="5" height="5" /></td>
												<td class="tdborderbottom"><img src="<s:url value="/images/spacer.gif"/>" width="1" height="1" /></td>
												<td width="5"><img src="<s:url value="/images/cphdzx_tab4.gif"/>" width="5" height="5" /></td>
											</tr>
										</table>
									</td>
								</tr>
							</table></td>
					</tr>
				</table>
				</s:form> 
</body>
<script>
//验证表单
function validate(){
	if(document.all['newprodReq.name'].value==""){
		alert("需求名称不能为空，请填写！");
		return false;
	}
	var contcontent = document.all['newprodReq.content'].value;
	if(contcontent==""){
		alert("需求内容不能为空，请填写！");
		return false;
	}
	if(contcontent.length > 500){
		alert("内容不大于500个字！请简写或者用附件上传！");
		return false;
	}
	return true;
}

function selectStartPerson(){
	var url="<s:url value='/' escapeAmp='false'/>"+"organ/selectPerson.action";
	var returnData=window.showModalDialog(url,window,"status:no;dialogWidth:960px;dialogHeight:640px;scroll:yes;");
	if(returnData){
		document.all['startPerson'].value=returnData[1];
		document.all['newprodReq.startPerson.id'].value=returnData[0];
		document.all['startDept'].value="";
		document.all['newprodReq.startDept.id'].value="";
	}
}
function selectProdPerson(){
	var url="<s:url value='/' escapeAmp='false'/>"+"organ/selectPerson.action";	
	var returnData=window.showModalDialog(url,window,"status:no;dialogWidth:960px;dialogHeight:640px;scroll:yes;");
	if(returnData){
		document.all['prodPerson'].value=returnData[1];
		document.all['newprodReq.prodPerson.id'].value=returnData[0];
		document.all['prodDept'].value="";
		document.all['newprodReq.prodDept.id'].value="";
	}
}
function submit1(){
	var time2=document.all['advanTime'].value;
	if(time2.length==10){
		document.all['newprodReq.advanTime'].value=document.all['advanTime'].value+" 00:00:00";
	}
	
	var uploads = document.getElementsByName("upload");
	var filetype = document.getElementsByName("filetype");
	
	if(uploads[0].value != null && uploads[0].value != ""){
		filetype[0].value = "COMPLAN";
	}else{
		filetype[0].value = "";
	}
}
function startup(){
	submit1();
	document.forms[0].action='startupNewprodReq.action';
}


function isNullSel(obj){
	if(obj&&obj.options&&obj.options.selectedIndex!=-1&&obj.options[obj.options.selectedIndex].value!=""){
		return false;
	}
	return true;
}
function selectPersonsBy(name,value){
    var url="/organ/selectPerson.action?returnObj="+value+"&returnObjName="+name;
    var returnData=window.showModalDialog(url,window,"status:no;dialogWidth:960px;dialogHeight:640px;scroll:yes;");
   	 if(returnData){
   	   	var objName=$("textarea[name='"+name+"']");
   	   	var obj=$("input:hidden[name='"+value+"']");
   	 	objName[0].value=returnData[1];
   	 	obj[0].value=returnData[0];
   	 if(returnData[1].split(",").length>15){
			alert("人数超出15个人，请重新选择！");
			$("input:hidden[name='overPerson']")[0].value="1";
	 	}else{
	 	$("input:hidden[name='overPerson']")[0].value="";
	 	}
 	 }
	}


</script>
</html>